package com.ruoyi.app.mapper;

import com.ruoyi.app.dto.PaymentParkCardDto;
import com.ruoyi.domain.ParkingCard;
import com.ruoyi.domain.ParkingCardOrder;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface AppMapper {

    AppMapper INSTANCE = Mappers.getMapper(AppMapper.class);

    @Mapping(source = "date", target = "validStartTime", dateFormat = "yyyy-MM-dd")
    ParkingCardOrder toParkingCardOrder(PaymentParkCardDto paymentParkCardDto);

    @Mapping(source = "payMethod", target = "channel")
    @Mapping(source = "id", target = "orderId")
    ParkingCard toParkingCard(ParkingCardOrder parkingCardOrder);

}
